
function recursionRoutes(allRoutes=[], menuList=[]) {
    let userMenu = [];//将匹配好的路由配置,放到这个数组
    menuList.forEach(item => {
        allRoutes.forEach(routes => {
            if (item.name === routes.meta.name) {
                if (item.children && item.children.length > 0) {
                    routes.children = recursionRoutes(routes.children, item.children)
                }
                userMenu.push(routes)
            }
        })
    })

    return userMenu
}

export default recursionRoutes